/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * This file is part of retabel.
 *
 * Copyright (c) 2011 by individual contributors as indicated by the
 * @author tags. See the copyright.txt file in the distribution
 * for a full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

package org.retabel.persistence.entity.number;

import javax.persistence.*;

/**
 * Entity to hold the information about unique numbers.
 * <p/>
 * <h3>Extra-Info</h3>
 * Created: 23:30 19.09.11
 *
 * @author Burt Parkers
 * @version 1.0
 */
@Entity
@NamedQueries({
    @NamedQuery(name = "UniqueNumber.findByNumberGroup",
                query = "select uniqueNumber from UniqueNumber uniqueNumber where uniqueNumber.numberGroup = ?1")
})
public class UniqueNumber {

    /** The id field. */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;

    /** The number group, to create a set of unique numbers. */
    @Column(nullable = false, length = 50, unique = true)
    private String numberGroup;

    /** The unique number. */
    @Column(nullable = false, precision=10, scale=0)
    private int number;

    /**
     * Returns the id.
     *
     * @return the id.
     */
    public int getId() {
        return id;
    }

    /**
     * Sets the id.
     *
     * @param id the id.
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * Returns the current number.
     *
     * @return the number.
     */
    public int getNumber() {
        return number;
    }

    /**
     * Sets the current number.
     *
     * @param number the number.
     */
    public void setNumber(int number) {
        this.number = number;
    }

    /**
     * Returns the number group.
     *
     * @return the number group.
     */
    public String getNumberGroup() {
        return numberGroup;
    }

    /**
     * Sets the number group.
     *
     * @param numberGroup the number group.
     */
    public void setNumberGroup(String numberGroup) {
        this.numberGroup = numberGroup;
    }
}
